{extend name="layout" /}
{block name="content"}
<div class="layui-card-header">{$pathCurrent['name']}</div>
<div class="layui-card-body">
	<div class="tableOp">
		<form class="layui-form">
			<div class="layui-row layui-col-space10">
				<div class="layui-col-md3">
					<div class="layui-form-item">
						<label class="layui-form-label">时间</label>
						<div class="layui-input-block">
				           	<input type="text" class="layui-input" datatype="*" name="time" id="endtime" placeholder="yyyy-MM-dd HH:mm:ss" readonly="" value="{$time}">
						</div>
					</div>
				</div>
				<div class="layui-col-md2">
					<div class="layui-form-item">
			      		<button class="layui-btn layui-btn-normal" style="height: 36px;min-width: 80px;" lay-submit="" lay-filter="search">搜索</button>
				  	</div>
				</div>
				<!--  -->
			</div>
		</form>
	</div>
	<div data-model="table-bind">
		<table class="layui-hide" id="data_table" lay-filter="data_table" data-table></table>
	</div>
</div>
<script type="text/html" id="barTar">
	<a class="layui-btn layui-btn-xs" href="{{d.op}}">查看详细</a>
</script>
{/block}
{block name="js"}
<script type="text/javascript">
var mixin = {};
var SlefUrl = this.location.href;
layui.use(['table','form','laydate'], function(){
	var table = layui.table,
	form = layui.form,
	laydate = layui.laydate;
	table.render({
		elem: '#data_table',
		toolbar: '#toolBar',
		url:SlefUrl,
		limit:20,
		cellMinWidth: 80,
		cols: [[
			{type: 'checkbox', width:80,fixed: 'left'}
	      	,{field:'id',width:80, title: 'ID', sort: true,align:'center'}
	      	,{field:'nickname', title: '所属代理'}
	      	,{field:'parent', title: '类型'}
	      	,{field:'money', title: '总数量'}
	      	,{field:'reg_time', title: '操作时间', width:150}
	      	,{field:'op', title: '操作',toolbar: '#barTar', width:100,align:'center'}
	    ]],
	    page: true
	});
	laydate.render({
	    elem: '#endtime',
	    type: 'datetime',
	    format: 'yyyy/MM/dd HH:mm:ss',
	    range: true
	 });
	table.on('tool(data_table)', function(obj){
		var data = obj.data;
		data.table = "agent";
		if(obj.event === 'del'){
			layer.confirm('确定删除吗？', function(index){
	        	layer.close(index);
	       		form.formDel(data,obj);
	      	});
		}
	});
});
</script>
{/block}